package cn.edu.nuc.ssm.controller;

import cn.edu.nuc.ssm.dto.Entity;
import cn.edu.nuc.ssm.service.TestProjectService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2017/4/1.
 */
@Controller
@RequestMapping("/demo")
public class DemoController {

    private Logger logger = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    private TestProjectService testProjectService;

    @ResponseBody
    @RequestMapping(value = "/demo",method = RequestMethod.POST )
    public String demo(String str){

        logger.debug(str);

        return "success";
    }
    @ResponseBody
    @RequestMapping(value = "/json111",method = RequestMethod.POST)
    public String json(@RequestBody Entity entity){

        logger.debug("请求的参数是:{}",entity.toString());

        return "success";
    }



}
